package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.check.ElementCheckRequest;
import com.cxso.example.request.check.PersonalCheckRequest;
import com.cxso.example.response.check.ElementCheckResponse;
import com.cxso.example.response.check.PersonalCheckResponse;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "身份验证")
public class CheckClient extends Client {

    public CheckClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "二三四要素认证")
    public Result<ElementCheckResponse> elementCheck(ElementCheckRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/check/operateElementCheck", HttpMethod.POST, req).toEntity(ElementCheckResponse.class);
    }

    @Schema(description = "人像比对")
    public Result<PersonalCheckResponse> personalCheck(PersonalCheckRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/check/operatePersonalCheck", HttpMethod.POST, req).toEntity(PersonalCheckResponse.class);
    }

}
